import { defineStore } from 'pinia'
import { localStorage } from '@/utils/storage'

export const appStore = defineStore('appStore', {
  state: () => ({
    name: localStorage.getItem('name') || 'Ice-Tools-Web'
  }),
  actions: {
    setName(name: string) {
      this.name = name
      localStorage.setItem('name', name)
    }
  }
})

export default appStore
